package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class DropColumnDefinition implements AlterTableAction {

    private final int beginIndex;
    private final int endIndex;
    private boolean column;
    private Identifier columnName;
    private DropBehavior dropBehavior;

    public DropColumnDefinition(int beginIndex, boolean column, Identifier columnName, DropBehavior dropBehavior) {
        this.beginIndex = beginIndex;
        this.endIndex = dropBehavior.getEndIndex();
        this.column = column;
        this.columnName = columnName;
        this.dropBehavior = dropBehavior;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public boolean isColumn() {
        return column;
    }

    public Identifier getColumnName() {
        return columnName;
    }

    public DropBehavior getDropBehavior() {
        return dropBehavior;
    }

}
